import request from '@/utils/request'

// 用户频道列表
export const getUserNewsListApi = () => {
  return request({
    method: 'get',
    url: '/app/v1_0/user/channels'
  })
}

// 频道新闻文章列表
export const getChannelNewsListApi = (params) => {
  return request({
    method: 'get',
    url: '/app/v1_1/articles',
    params
  })
}

// 全部频道列表
export const getChannelListsApi = () => {
  return request({
    method: 'get',
    url: '/app/v1_0/channels'
  })
}

// 添加修改频道
export const getRevampChannelApi = (data) => {
  return request({
    method: 'patch',
    url: '/app/v1_0/user/channels',
    data
  })
}

// 删除指定的频道
export const getRemoveChannelApi = (id) => {
  return request({
    method: 'delete',
    url: `/app/v1_0/user/channels/${id}`
  })
}
